package com.mingtu.jgspatrol.adapter;

import androidx.annotation.NonNull;

import com.blankj.utilcode.util.StringUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mingtu.jgspatrol.R;
import com.mingtu.jgspatrol.bean.AllReportRecordBean;

public class AllRecordReportAdapter extends BaseQuickAdapter<AllReportRecordBean.DataBean.ListBean, BaseViewHolder> {


    public AllRecordReportAdapter() {
        super(R.layout.item_all_record_report);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, AllReportRecordBean.DataBean.ListBean listBean) {
        String eventCode = listBean.getEventCode();
        String name = listBean.getName();
        String createTime = listBean.getCreateTime();
        String address = listBean.getAddress();
        String tag = listBean.getTag();


        if (!StringUtils.isEmpty(eventCode)) {
            helper.setText(R.id.tv_event_code, "编号：" + eventCode);
        }
        if (!StringUtils.isEmpty(name)) {
            helper.setText(R.id.tv_name, name);
        }
        if (!StringUtils.isEmpty(createTime)) {
            helper.setText(R.id.tv_create_time, createTime);
        }
        if (!StringUtils.isEmpty(address)) {
            helper.setText(R.id.tv_address, address);
        }

        if (!StringUtils.isEmpty(tag)) {
            helper.setText(R.id.tv_type, tag);
        }
    }

}
